package q203_removeElements;

import CommonClass.Common.ListNode;
public class Solution_2 {

    /*
    简单的迭代
     */
    public ListNode removeElements(ListNode head, int val) {
        if (head == null) {
            return null;
        }
        head.next = removeElements(head.next, val);
        return head.val == val ? head.next : head;
    }
}
